import { request } from '@/utils'

export const articleGetChannelListService = () => {
  return request.get('/channels')
}

export const articlePublishService = (data) => {
  return request.post('/mp/articles', data)
}

export const articleGetListService = (params) => {
  return request.get('/mp/articles', { params })
}

export const articleDeleteArticleService = (id) => {
  return request.delete(`/mp/articles/${id}`)
}

export const articleGetArticleDetailService = (id) => {
  return request.get(`/mp/articles/${id}`)
}

export const articleUpdateArticleService = (data) => {
  return request.put(`/mp/articles/${data.id}/?draft=false`, data)
}
